<?php $this->display('header') ?>
<link href="{$_W['siteroot']}../addons/{MOD_ADD}/static/admin/H/css/plugins/iCheck/custom.css" rel="stylesheet">
<!-- iCheck -->
<script src="{$_W['siteroot']}../addons/{MOD_ADD}/static/admin/H/js/plugins/iCheck/icheck.min.js"></script>
</head>
<body>
<div id="wrapper">
    <!--左侧导航开始-->
    <?php $this->display('menu') ?>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <?php $this->display('header_top') ?>
        <div class="ibox-content">
            <form class="cmxform form-horizontal tasi-form" id="form_name" name="form_name">
                <div class="form-group row" id="group">
                    <label for="username" class="col-sm-2 control-label">角色</label>
                    <div class="col-sm-5">
                        <select class="form-control m-bot15" name="group_id">
                            {loop $group $v}
                            <option value="{$v['id']}"  {if $admin_group['group_id'] == $v['id']} selected {/if}>{$v['title']}</option>
                            {/loop}
                        </select>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label for="username" class="col-sm-2 control-label">登录名</label>
                    <div class="col-sm-6">
                        <input type="text" id="username" name="username" value="{$aData['username']}" class="form-control">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label for="realname" class="col-sm-2 control-label">真实姓名</label>
                    <div class="col-sm-6">
                        <input type="text" id="realname" name="realname" value="{$aData['realname']}" class="form-control">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label class="col-sm-2 control-label">手机号码</label>
                    <div class="col-sm-6">
                        <input type="text" maxlength="11" onkeyup="value=value.replace(/[^\d]/g,'')" name="mobile"
                               value="{$aData['mobile']}" class="form-control" >
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group  row">
                    <label class="col-sm-2 control-label">设置密码</label>
                    <div class="col-sm-6">
                        <input class="form-control" id="passwd" name="passwd"  type="text" placeholder="请输入6-12位密码"  maxlength="12"/>
                        <span class="help-block">*注意 : 不填写则不修改密码*</span>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group row">
                    <div class="col-sm-2 col-sm-offset-2"></div>
                    <div class="col-sm-4 col-sm-offset-2">
                        <input type="hidden" value="{php echo gWebUrl('admin/edit',['admin_id'=>$aData['admin_id']])}" id="url_class" name="url_class">
                        <button class="ladda-button btn btn-info" data-style="slide-right" id="form_submit">提交
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--右侧部分结束-->
</div>
<!--表单验证-->
<script src="https://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
<script src="https://static.runoob.com/assets/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>
<?php $this->display('foot') ?>
<script>
    $('.i-checks').iCheck({
        checkboxClass: 'icheckbox_square-green',
        radioClass: 'iradio_square-green'
    });
    $.validator.setDefaults({
        submitHandler: function () {
            if (!$(this).hasClass('disabled')) {
                $(this).addClass('disabled');
                //验证
                postFormData('form_name');
                setTimeout("$('#form_submit').removeClass('disabled')", 2000);
                return false;
            }
        }
    });
    $().ready(function () {
        $("#form_name").validate({
            rules: {
                username: "required",
                realname: "required",
                mobile: "required",
            },
            messages: {
            }
        })
    });
</script>